//
//  HttpCustomerAction.m
//  EPBPro
//
//  Created by wucha on 2018/7/3.
//  Copyright © 2018年 fc. All rights reserved.
//

#import "HttpCustomerAction.h"

@implementation HttpCustomerAction

+(void)getCustomerList:(NSDictionary*)dic block:(HTTPResultBlock)block{
    NSString *requestString = [Utils getUrlWithAction:ActionSearchCustomer parmasAndKeys:nil];
//    NSDictionary *dic = [Utils objectToDictionary:customerActionInfo];
    [self postRequestWithRequest:requestString withParam:dic jsonSelector:@selector(getCustomerListResultWithResponseData:) finish:block];
}

+(void)getAllCustomerGain:(HTTPResultBlock)block{
    NSString *requestString = [Utils getUrlWithAction:ActionAllCusGain parmasAndKeys:nil];
    [self postRequestWithRequest:requestString withParam:nil jsonSelector:@selector(getAllCustomerGainResultWithResponseData:) finish:block];

}

+(void)postAddCustomer:(CustomerActionInfo*)customerActionInfo block:(HTTPResultBlock)block{
    NSString *requestString = [Utils getUrlWithAction:ActionAddCustomer parmasAndKeys:nil];
    NSDictionary *dic = [Utils objectToDictionary:customerActionInfo];
    [self postRequestWithRequest:requestString withParam:dic jsonSelector:@selector(getAddCustomerResultWithResponseData:) finish:block];
}

+(void)getCustomerInfo:(NSString*)customerId block:(HTTPResultBlock)block{
    NSString *requestString = [Utils getUrlWithAction:[NSString stringWithFormat:@"%@%@",ActionCustomerGain,customerId] parmasAndKeys:nil];
    [self requestWithRequest:requestString jsonParserSelector:@selector(getCustomerDetailResultWithResponseData:) finish:block];

}

+(void)postAddAsset:(AssetActionInfo*)assetActionInfo block:(HTTPResultBlock)block{
    NSString *requestString = [Utils getUrlWithAction:ActionAddCustomerGain parmasAndKeys:nil];
    NSDictionary *dic = [Utils objectToDictionary:assetActionInfo];
    [self postRequestWithRequest:requestString withParam:dic jsonSelector:@selector(getAddCustomerAssetResultWithResponseData:) finish:block];

}

+(void)postRedeemAsset:(NSString*)assetId block:(HTTPResultBlock)block{
    NSString *requestString = [Utils getUrlWithAction:[NSString stringWithFormat:@"%@%@",ActionRedeemAsset,assetId] parmasAndKeys:nil];
    [self postRequestWithRequest:requestString withParam:nil jsonSelector:@selector(getRedeemAssetResultWithResponseData:) finish:block];

}


+(void)postProfitMonthly:(NSDictionary*)dic block:(HTTPResultBlock)block{
    NSString *requestString = [Utils getUrlWithAction:ActionMonthGain parmasAndKeys:nil];
    [self postRequestWithRequest:requestString withParam:dic jsonSelector:@selector(getProfitMonthlyResultWithResponseData:) finish:block];

}

@end
